package com.nwpusp.display.views.components;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.view.View;

import com.example.petssports.R;
import com.nwpusp.display.GlobalVar;

public class ResultWord extends View{
	public Bitmap ResultBitmap;
	public float x;
	public float y;
	public float scale;
	public float width;
	public float height;
	public int index;
	public boolean isWinner;
	
	public ResultWord(Context view,float scale,boolean isWinner){
		super(view);
		this.scale = scale;
		this.isWinner = isWinner;
		getBitmapSource();
		ResultBitmap = GlobalVar.VerticalScale(ResultBitmap,scale);
		width = ResultBitmap.getWidth();
		height = ResultBitmap.getHeight();
	}
	
	public void setLocation(float x ,float y){
		this.x = x;
		this.y = y;
	}
	
	private void getBitmapSource(){
		if(isWinner)
			ResultBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.winword);
		else 
			ResultBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.loseword);
	}
	
	public Bitmap draw(){
		return ResultBitmap;
	}

}